<template>
  <el-select v-model="name" placeholder="请选择角色" multiple>
    <el-option v-for="item in options" :key="item.id" :label="item.name" :value="item.id" />
  </el-select>
</template>

<script setup lang="ts">
import { onMounted } from "vue";

const { proxy } = getCurrentInstance();
let props = defineProps(["modelValue"]);
const emit = defineEmits(["update:modelValue"]);
let options = ref([]);

onMounted(() => {
  getInfo();
});

const name = computed({
  get() {
    return props.modelValue;
  },
  set(value: Number) {
    emit("update:modelValue", value);
  },
});

let getInfo = async () => {
  options.value = await proxy.$apis.roleQuery();
  console.log("分页", options.value);
};
</script>

<style lang="scss" scoped>
</style>
